
{include file="common/head"}
<head>
	<title>{$sys['tdk1']}</title>
	<meta name="Keywords" content="{$sys['tdk2']}" />
	<meta name="Description" content="{$sys['tdk3']}" />
	<style>
		#search_box{
			line-height: 35px;border-radius: 20px;position: absolute;top: 5px;left: 10%;right:10%;border: 0;text-align: center;z-index: 10;opacity: 0.2;transition: 0.1s;
		}
		#search_btn{
			z-index: 11;position: absolute;right: 11%;top: 10px;border-radius: 50%;
		}

		.row{margin: 0;}
		#top{background-imagex: linear-gradient(to right,#C63927, #FA842B);border-bottom: 0 solid #000;z-index: 21;border:0;}
		.section{background-color: #fff;padding:6px;margin: 10px 0;border:2px solid #f60;}
		.section-title{color:#C63927;font-weight: bold;padding: 0 6px;font-size: 1.1rem;}

		.row div{padding: 0;}
		a{text-decoration: none;}
		.goods{padding: 0;display: flex;justify-content: flex-start;flex-wrap: wrap;}
		.flex_item{border: 0 solid #ccc;width:{$sys.item_width};margin:0px;position: relative;padding: 2px;cursor: pointer;}
		.ad_box{border:1px solid #ccc;position: relative;}
		.ad_box:hover{border:2px solid #f60;}
		.tag{position: absolute;right:-2px;bottom:-2px;border:1px solid #ccc;background: #000;color:#fff;opacity: 0.6;}
		.bar{width:48%;border:1px solid #ccc;height:140px;cursor: pointer;auto;margin:1%;}
		#bottom {text-align: center;background:#fff;		}
	</style>
</head>

<body >
		
	<!-- Swiper -->
 	<!--<div class="swiper-container" style="height:30%;max-width: 1200px">
	    <div class="swiper-wrapper">

	        	<div class="swiper-slide">
	        		<img src="" style="width:100%;" />
	        	</div>


	    </div>
	    <div class="swiper-pagination"></div>
	</div> -->

	<div class="container-x" style="max-width: 1000px;margin:0 auto;">
	<!-- 内容 -->	

	<div id="content" >
		<!-- shop list -->
		<div class="section" style="border: 0">
			<div class="row">

				<div class="col-3 fs-4" style="font-weight: bold;">
					{$sys.company_name}
				</div>

				<div class="col fs-4" style="text-align: right;">
					{if !$user}
					<a href='/admin' >登录</a>&nbsp;
					<a href='/user/user_add' >注册</a>				
					{else}
					【{$user['name']}】<a href="/admin">我的后台</a>
					{/if}
				</div>

			</div>

		</div>
		<!-- hots goods -->
		<div class="section">
			<!-- <div class="section-title">精品推荐1</div> -->
			<div class="goods" >
				{foreach $ads as $kv}
					{if $kv['cat_id']==3}
					<div class="flex_item" g_id="{$kv['id']}" link="{$kv['link_url']}" >
						<div class='ad_box' >
							{if $kv['status']!=1}
								<img src="/upload/close.jpg" style="width:100%;height:{$sys.ad_img_height};" />
								<div class='tag'>广告位关闭</div>
							{else}

								{if $kv['show']}
									<img src="{$kv['img1']}" style="width:100%;height:{$sys.ad_img_height};" />
									<div class='tag'>广告</div>
								{else}
									<img src="/upload/zz.jpg" style="width:100%;height:{$sys.ad_img_height};" />
									<div class='tag'>{$kv['name']}</div>
								{/if}

							{/if}
						</div>
					</div>
					{/if}
				{/foreach}
			</div>
		</div>

		<div class="section">
			<!-- <div class="section-title">精品推荐2</div> -->
			<div class="goods" >
				{foreach $ads as $kv}
					{if $kv['cat_id']==4}
					<div class="flex_item" g_id="{$kv['id']}" link="{$kv['link_url']}" >
						<div class="ad_box">
						{if $kv['user_id']!=''}
							<span style='color:red;'>{$kv['text']}</span>
						{else}
							{$kv['desc']}招租 {$kv['name']}
						{/if}
						</div>
					</div>
					{/if}
				{/foreach}
			</div>
		</div>
	

		<div class="section">
			<div class="goods" g_id="{$kv['id']}" link="{$kv['link_url']}">
			{foreach $ads as $kv}
				{if $kv['cat_id']==5}
					<div class="bar ad_box" >
						<img src="{$kv['img1']}" style="width:100%;height: 100%;" />
					</div>
				
				{/if}
			{/foreach}
			</div>
		</div>

<!-- 		<div class="section" style="margin-bottom: 50px;">
			{$sys.about_msg | raw}
		</div> -->

		<div  style="height:50px;"></div>
			

	</div>


	<div id="mask"></div>
	

	<input type="hidden" value="{$sys.msg}" id="show_msg" />

	<!-- 底部栏 -->
	<div style="height: 60px;"></div>
	<div id="bottom">
		<c class="text-info">{$sys.copy_right} </c> &nbsp;&nbsp;
		<a href="https://beian.miit.gov.cn/">{$sys.beian}</a> &nbsp;&nbsp;
		<c>QQ:{$sys.qq}</c>
	</div>


<script type="text/javascript">
	$(document).ready(function(){
		var msg=$("#show_msg").val().trim();

    $(".flex_item").on('click',function(){
    	var g_id= $(this).attr('g_id');
    	var link =$(this).attr('link');
    	if(!link) return;
    	$.post('/goods/click',{gid:g_id},function(res){
					if (res.code == 1) {
						layer.msg('即将跳转...'+link );
						setTimeout(function(){window.open(link,'_blank');},1000)
					} else {
						layer.open({ content: res.msg });
					}
    	})

    })

    $(".flex_item").on('focus',function(){
    	console.log(1)
    });

		$("#mask").on('click',function(){
			$(this).hide();
		})




	});
</script>
</body>
</html>